import Vue from "vue";
import VueRouter from "vue-router";
// eslint-disable-next-line no-unused-vars
import Home from "../views/Home.vue";

import HomePage from "@components/home/HomePage";
import Login from "@components/login/Login";

import eHeader from "@components/public/Header";
import eContentFrame from "@components/public/ContentFrame";
import eFooter from "@components/public/Footer";
import MessageList from "@components/details/MessageList";
import SearchText from "@components/details/SearchText";
import MessageDetails from "@components/details/MessageDetails";
import AdvDetails from "@components/details/AdvDetails";
import PostMessage from "@components/details/PostMessage";
import Usercenter from "@components/usercenter/Usercenter";
import Aboutus from "@components/usercenter/Aboutus";

Vue.use(VueRouter);

const routes = [
  // {
  //   path: "/",
  //   name: "Home",
  //   component: Home
  // },
  {
    // ************网站主页
    path: "/",
    name: "HomePage",
    component: HomePage,
    meta: {
      //这个就是需要改变的title
      title: "机械整合_行业领导者"
    }
  },
  {
    // ************网站登录页
    path: "/Login",
    name: "Login",
    component: Login,
    meta: {
      title: "用户登录"
    }
  },
  {
    // ************网站主页头部
    path: "/eHeader",
    name: "eHeader",
    component: eHeader,
    meta: {
      title: "主页头部"
    }
  },
  {
    // ************网站主页主体
    path: "/eContentFrame",
    name: "eContentFrame",
    component: eContentFrame,
    meta: {
      title: "主页主体"
    }
  },
  {
    // ************网站主页尾部
    path: "/eFooter",
    name: "eFooter",
    component: eFooter,
    meta: {
      title: "主页尾部"
    }
  },
  {
    // ************网站文章列表页
    path: "/MessageList",
    name: "MessageList",
    component: MessageList,
    meta: {
      title: "文章列表"
    }
  },
  {
    // ************网站广告详情页
    path: "/AdvDetails",
    name: "AdvDetails",
    component: AdvDetails,
    meta: {
      title: "广告详情"
    }
  },
  {
    // ************网站文章搜索页
    path: "/SearchText",
    name: "SearchText",
    component: SearchText,
    meta: {
      title: "文章搜索"
    }
  },
  {
    // ************网站文章详情页
    path: "/MessageDetails",
    name: "MessageDetails",
    component: MessageDetails,
    meta: {
      title: "文章详情"
    }
  },
  {
    // ************网站文章发布页
    path: "/PostMessage",
    name: "PostMessage",
    component: PostMessage,
    meta: {
      title: "发布文章"
    }
  },
  {
    // ************网站个人中心页
    path: "/Usercenter",
    name: "Usercenter",
    component: Usercenter,
    meta: {
      title: "个人中心"
    }
  },
  {
    // ************网站关于我们
    path: "/Aboutus",
    name: "Aboutus",
    component: Aboutus,
    meta: {
      title: "关于我们"
    }
  },
  {
    path: "/about",
    name: "About",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/About.vue")
  }
];

const router = new VueRouter({
  routes
});

export default router;
